//
//  PAHttpRequest.m
//  PAFramework
//
//  Created by Gavin Zhang on 7/17/13.
//  Copyright (c) 2013 Gavin Zhang. All rights reserved.
//

#import "PAHttpRequest.h"

@implementation PAHttpRequest
@synthesize paNetDelegate;
@synthesize bufferData;
@synthesize operationType;
+(id)requestWithURL:(NSURL *)newURL
{
    return [[self alloc] initWithURL:newURL];
}

- (void)startAsynchronous
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cancel) name:NOT_ViewDidUnload object:nil];
    [super startAsynchronous];
}

- (void)listenViewDidUnload:(NSNotification *)notf
{
    id sender = [notf object];
    if (sender == self.paNetDelegate) {
        [self cancel];
    }
}
@end
